package com.reins.bookstore.entity;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Data
@Entity
@Table(name = "course")
@JsonIgnoreProperties(value = {"handler","hibernateLazyInitializer","fieldHandler"})
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class,property = "courseId")
public class Course {

    @Id
    @Column(name = "courseId")
    private int courseId;
    private String courseTeacher;
    private String courseName;
    private String courseType;
    private String courseTime;
    private int courseViews;
    private String courseRemark;
    private String userId;
    private String courseDai;
    public Course(int courseId, String courseTeacher, String courseName, String courseType, String courseTime,int courseViews,String courseRemark,String userId,String courseDai){
        this.courseId = courseId;
        this.courseTeacher = courseTeacher;
        this.courseName = courseName;
        this.courseType = courseType;
        this.courseTime = courseTime;
        this.courseViews = courseViews;
        this.courseRemark = courseRemark;
        this.userId = userId;
        this.courseDai = courseDai;
    }

    public Course() {

    }
}
